18. Exercise: Implement Topic Following

25 Implement Topic Following Code

Implement Topic Following

Time to let our users actually follow our Squawker instructors! By the end of this exercise, you should be able to send a message from a particular instructor, from the Squawker server, and receive it only on devices that are following that instructor.

Preferences lesson

If you need to refresh your memory on how to set up preferences and listen to value changes check out this lesson in the first Android course.

Exercise Code

Exercise: TFCM.05-Exercise-ImplementInstructorTopicFollowing

To send an Instructor Squawk, you'll need to enter your server key and then you can pick an instructor from the list, as seen below. The following would, trigger the server to send a message from "Lyla", by sending a message from the "key_lyla" topic.

Task Description:

Complete the TODOs in the code to receive topic messages from different instructors.

Task List:

Task Feedback:

Excellent work! You can now follow your favorite instructors.

Solution: [TFCM.05-Solution-ImplementInstructorTopicFollowing][Diff]